package gui.Student;

import javax.swing.JPanel;
import java.awt.SystemColor;
import javax.swing.JLabel;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.border.TitledBorder;

import System.MainControl;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class AvailableExam extends JPanel implements ActionListener{
	/**
	 * 
	 */
	private static final long serialVersionUID = -8750710468986552253L;
	private JTextField textField;
	private JButton btnNewButton;
	/**
	 * Create the panel.
	 */
	public AvailableExam() {
		super();
		initialize();
	}
	/**
	 * Create the panel.
	 */
	public void initialize() {
		setBorder(new TitledBorder(null, "Available Exam", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		setBackground(SystemColor.activeCaption);
		setBounds(100, 100, 622, 284);
		setLayout(null);
		
		JLabel lblHooseExam = new JLabel("Choose Exam:");
		lblHooseExam.setBounds(10, 31, 85, 14);
		add(lblHooseExam);
		
		JLabel lblNewLabel = new JLabel("Choose Exams Type:");
		lblNewLabel.setBounds(10, 88, 101, 14);
		add(lblNewLabel);
		
		JLabel lblExamCode = new JLabel("Exam Code:");
		lblExamCode.setBounds(10, 149, 101, 14);
		add(lblExamCode);
		
		JComboBox comboBox = new JComboBox();
		comboBox.setBounds(154, 28, 85, 20);
		add(comboBox);
		
		JComboBox comboBox_1 = new JComboBox();
		comboBox_1.setModel(new DefaultComboBoxModel(new String[] {"Manual", "Computerized"}));
		comboBox_1.setBounds(154, 85, 85, 20);
		add(comboBox_1);
		
		textField = new JTextField();
		textField.setBounds(153, 146, 86, 20);
		add(textField);
		textField.setColumns(10);
		
		JButton btnGo = new JButton("Go");
		btnGo.setFont(MainControl.guiFont);
		btnGo.addActionListener(this); 
		btnGo.setBounds(265, 214, 89, 23);
		add(btnGo);
		
		btnNewButton = new JButton("Back");
		btnNewButton.setFont(MainControl.guiFont);
		btnNewButton.addActionListener(this);
		btnNewButton.setBounds(497, 214, 89, 23);
		add(btnNewButton);

	}

	@Override			
	public void actionPerformed(ActionEvent e) 
	{
		if(e.getSource() == btnNewButton)
		{
			MainControl.setGUI(MainControl.currentUser.getRole(), this);
		}
	};
}

